/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lucava.lib.shared.service;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author glenn
 */
public class RemoteResponse<T> implements Serializable {

    private T value;
    private Boolean success;
    private List<String> messages;

    private RemoteResponse() {
    }

    public RemoteResponse(T value, Boolean success) {
        this.value = value;
        this.success = success;
        this.messages = new ArrayList<String>();
    }

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public Boolean isSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public Boolean hasMessages() {
        return !messages.isEmpty();
    }

    public List<String> getMessages() {
        return messages;
    }

    public void addMessages(String message) {
        this.messages.add(message);
    }

    public void setMessages(List<String> messages) {
        this.messages = messages;
    }
}
